package fr.ece.si.ing5.madboomview;

import fr.ece.si.ing5.madboom.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.Button;

public class GameRules extends Activity implements OnClickListener,
		OnTouchListener {
	private Button okButton = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.activity_rules);

		okButton = (Button) findViewById(R.id.ok_button);

		okButton.setOnClickListener(this);
		okButton.setOnTouchListener(this);
	}

	@Override
	public boolean onTouch(View v, MotionEvent event) {
		switch (v.getId()) {
		case R.id.ok_button:
			okButton.setBackground(getResources().getDrawable(R.drawable.ok2));
			break;
		}
		return false;
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.ok_button:
			finish();
			okButton.setBackground(getResources().getDrawable(R.drawable.ok));
			break;
		}
	}
}